<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link href="/lib/layui/css/layui.css" rel="stylesheet"/>
    <link href="/css/common.css" rel="stylesheet"/>
    <title>分页查询错误日志</title>
</head>
<body>
<div class="layui-fluid">
    <div class="layui-row">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">
                    <form class="layui-form">
                        <div class="layui-form-item">
                            <div class="layui-inline">
                                <button class="layui-btn layui-btn-danger deleteBtn" data-url="/system/errorlog/remove.do">删除</button>
                                <button class="layui-btn layui-btn-danger deleteAllBtn" data-url="/system/errorlog/delete.do">清空</button>
                            </div>
                            <div class="layui-inline">
                                <label class="layui-form-label">接口名称：</label>
                                <div class="layui-input-inline">
                                    <input class="layui-input" type="text" name="functionUrl" placeholder="请输入接口名称" autocomplete="off">
                                </div>
                            </div>
                            <div class="layui-inline">
                                <label class="layui-form-label">接口类型：</label>
                                <div class="layui-input-inline">
                                    <select id="operateType" name="functionType" title=""></select>
                                </div>
                            </div>
                            <div class="layui-inline">
                                <label class="layui-form-label">访问用户：</label>
                                <div class="layui-input-inline">
                                    <input class="layui-input" type="text" name="userName" placeholder="请输入访问用户" autocomplete="off">
                                </div>
                            </div>
                            <div class="layui-inline">
                                <label class="layui-form-label">访问地址：</label>
                                <div class="layui-input-inline">
                                    <input class="layui-input" type="text" name="ipAddress" placeholder="请输入访问地址" autocomplete="off">
                                </div>
                            </div>
                            <div class="layui-inline">
                                <button class="layui-btn" lay-filter="searchBtn" lay-submit>搜索</button>
                                <button class="layui-btn" type="reset">重置</button>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="layui-card-body">
                    <table class="layui-hide" id="layuiTable" lay-filter="tableTool"></table>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/html" id="tableToolBar">
    <a class="layui-btn layui-btn-xs" lay-event="edit" data-title="详情" data-url="/system/errorlog/errorLogEdit.html">详情</a>
    <a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="delete" data-url="/system/errorlog/remove.do">删除</a>
</script>
<script src="/lib/layui/layui.all.js" charset="utf-8"></script>
<script src="/script/common.js" charset="utf-8"></script>
<script>
    layui.use(['baseUtil'], function () {
        var baseUtil = layui.baseUtil;

        baseUtil.initDict('operateType', function (dictContent) {
            baseUtil.initSelect(dictContent, 'operateType', '1');

            var url = '/system/errorlog/findPage.do';
            var cols = [
                { type: 'checkbox', align: 'center', fixed: 'left' },
                { type: 'numbers', title: '序号', align: 'center', fixed: 'left' },
                { field: 'className', title: '类名称', align: 'center' },
                { field: 'functionName', title: '方法名称', align: 'center' },
                { field: 'functionUrl', title: '接口名称', align: 'center' },
                {
                    field: 'functionType', title: '接口类型', align: 'center', templet: function (d) {
                        return baseUtil.showDictContent(dictContent, 'operateType', d.functionType);
                    }
                },
                { field: 'userName', title: '访问用户', align: 'center' },
                { field: 'ipAddress', title: '访问地址', align: 'center' },
                { field: 'createTime', title: '访问时间', align: 'center', width: 180 },
                { title: '操作', align: 'center', fixed: 'right', width: 150, toolbar: '#tableToolBar' }
            ];
            baseUtil.initPage(url, cols);
        });
    });
</script>
</body>
</html>
